package cn.biplam.front.template.control.table.cell;

import cn.biplam.common.tools.TOOLS;
import cn.biplam.common.wrapper.ErrorMessage;
import cn.biplam.front.html.HtmlText;
import cn.biplam.front.html.base.HtmlWindow;

/**
 * 内容为下拉列表的单元格模版
 * @author XiaoRuxing 2009-5-13上午11:26:02
 * @version 1.0
 */
public class SelectCell extends Cell{
	
	/** 下拉列表 */
	private HtmlWindow select;
	private HtmlText title;
	private int iTitleLength;
	
	public SelectCell(HtmlWindow select,String title) throws ErrorMessage{
		this.select=select;
		select.setMarginTop("3");
		this.title=new HtmlText(null,"il",title);
		iTitleLength=TOOLS.getTextLength(title)+4;
	}
	
	/**
	 * 获取单元格占位宽度
	 * @return 返回单元格占位宽度
	 */
	public int _getLength(){
		return select.getLength()+iTitleLength;
	}
	
	public void getContent() throws ErrorMessage{
		this.put(title);
		this.put(select);
	}
}
